package org.fmi.lje.graphics.model;

import java.awt.Font;
import java.awt.Graphics;

import org.fmi.lje.graphics.LayoutManager;

public class Shape {

	private int x;
	private int y;

	private int height;
	private int width;

	private Shape parent;

	protected Shape(int x, int y, int height, int width, Shape parent) {
		this.x = x;
		this.y = y;
		this.height = height;
		this.width = width;
		this.parent = parent;
	}

	protected Shape(int height, int width, Shape parent) {
		this(0, 0, height, width, parent);
	}

	public int getX() {
		return x;
	}

	protected void setX(int x) {
		this.x = x;
	}

	public int getY() {
		return y;
	}

	protected void setY(int y) {
		this.y = y;
	}

	public int getHeight() {
		return height;
	}

	protected void setHeight(int height) {
		this.height = height;
	}

	public int getWidth() {
		return width;
	}

	protected void setWidth(int width) {
		this.width = width;
	}

	public Shape getParent() {
		return parent;
	}

	public void setParent(Shape parent) {
		this.parent = parent;
	}
	
	protected LayoutManager getLayoutManager() {
		return parent.getLayoutManager();
	}

	public void draw() {
		getGraphics().drawRect(getX(), getY(), getWidth(), getHeight());		
	}

	protected Graphics getGraphics() {
		return getParent().getGraphics();
	}
	
	public Font getFont() {
		return getParent().getFont();
	}
	
	
}
